package org.pupil.rpc.common;

import org.pupil.rpc.protocol.RpcResponse;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
 * 连接请求
 * 生成请求id，并与对应的RpcFuture进行绑定，方便获取相对应的服务器返回的消息
 */
public class RpcRequestHolder  {
    // 请求id
    public final static AtomicLong REQUEST_ID_GEN = new AtomicLong(0);

    // 绑定请求
    public static final Map<Long, RpcFuture<RpcResponse>> REQUEST_MAP = new ConcurrentHashMap<>();
}
